|
|
|
|
|
|
|
Dim cFile As String
Dim cMsg As String
Dim nReturn As Integer
'Define the file to open
cFile = "C:\ABC.TXT"
'Open the file
Open cFile For Input As 1
MsgBox "ABC.TXT has been opened."
GoTo Command2ClickExit
'Error handler
Command2ClickErr:
If Err = 53 Then
cMsg = "Unable to open ABC.TXT!" + Chr(13)
cMsg = cMsg + "Select OK to locate this file. "
cMsg = cMsg + "Select CANCEL to exit this program." + Chr(13)
nReturn = MsgBox(cMsg, vbCritical + vbOKCancel, "Command2Click")
If nReturn = vbOK Then
CommonDialog1.filename = cFile
CommonDialog1.DefaultExt = ".txt"
CommonDialog1.ShowOpen
Resume
Else
Unload Me
End If
Else
MsgBox CStr(Err.Number) & " - " & Err.Description
Resume Next
End If
'Routine exit
Command2ClickExit:
End Sub |
|
|
|
|
|
|
|
|
1. You use the INSERT statement to insert data into tables. The basic form of this statement is |
|
|
|
|
|
|
|
|
INSERT INTO TableName(field1, field2,...) VALUES(value1, value2,...); |
|
|
|
|
|
|
|
|
2. You use the INSERT INTO_FROM statement to insert multiple records into a data table. The format of this statement is |
|
|
|
|
|
|
|
|
INSERT INTO TargetTable SELECT field1, field2 FROM SourceTable; |
|
|
|
|
|
|
|
|
3. You use the UPDATE_SET statement to modify existing data. This statement uses the following form: |
|
|
|
|
|
|
|
|
UPDATE <table name> SET <field to update> = <New Value>; |
|
|
|
|
|